package com.moyu.oasys.attendance.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalTime;

/**
 * @Author 赵彦博
 * @Date 2024/12/2 20:18
 */
@Data
public class Attendance {

    /**
     * 主键ID
     */
    @NotNull(message = "ID不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 用户ID
     */
    private Long userId;
    /**
     * 打卡日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate clockDate;
    /**
     * 签到时间
     */
    private LocalTime clockInTime;
    /**
     * 签退时间
     */
    private LocalTime clockOutTime;
    /**
     * 迟到分钟数
     */
    private Integer comeLateMinutes;
    /**
     * 早退分钟数
     */
    private Integer leaveEarlyMinutes;

}
